package class1;

public class Student {
    String name;
    double chinese;
    double math;

    public void printTotalScore() {
        System.out.println("同学各科总成绩为:" + (chinese + math));
    }

    public void printAverageScore() {
        System.out.println("同学各科平均成绩:" + (chinese + math) / 2);
    }

    public void printThis() {
        System.out.println(this);
    }

}
//一个class类可以构建多个对象,但只能有一个被public修饰,且只能修饰文件名那个对象
class car {
    String name;
    int money;
}
//public class phone {
//
//}这是一个错误的实例

